#include "widget.h"
#include "ui_widget.h"
#include <QDebug>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    connect(this, &Widget::MySignals, this, &Widget::MySlot);
    EmitSignals(); //发射信号
    ui->setupUi(this);
}

void Widget::MySlot()
{
    qDebug() << "world";
}

void Widget::EmitSignals()
{
    QString str = "Hello";
    emit MySignals(str);
}

Widget::~Widget()
{
    delete ui;
}
